/**
 * 
 */
package spaceinvaders;


import static org.junit.Assert.*;

import java.io.IOException;

import org.junit.BeforeClass;
import org.junit.Test;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

/**
 * @author hck
 *
 */
public class TextureLoaderTest {

	/**
     * Sets up the test fixture. 
     * (Called before every test case method.)
     */
    @BeforeClass
    public static void setUpBeforeClass() {
    	try {
			Display.setDisplayMode(new DisplayMode(800, 600));
			Display.create();
			System.out.println("Working Directory = " +
			           System.getProperty("user.dir"));
			System.out.println("Class path = " + System.getProperty("java.class.path"));
		} catch (LWJGLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    
	@Test
	public void testloadImage() throws IOException {
		TextureLoader cInvestigation = new TextureLoader();
		// Texture result = cInvestigation.getTexture("res/sweeper.gif");
		Texture result = cInvestigation.getTexture("ship.gif");
		assertEquals(result, true);
	}
	@Test
	public void testloadImage_DoesNotExist() throws IOException {
		TextureLoader cInvestigation = new TextureLoader();
		Texture result = cInvestigation.getTexture("DoesNotExist");
		assertEquals(result, true);
	}

}
